<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>操作列表</title>
	<!-- jsp文件头和头部 -->
	<%@ include file="/WEB-INF/views/layout/top.jsp"%> 
    <script type="text/javascript">
        $(function () {
        	gridList();
        });
      	//检索
		function search(){

		}
        //刷新
        function windowload() {
            $("#gridList").pqGrid("refreshDataAndView");
        }
	    //加载列表
        function gridList() {
            var url = "<%=root%>${classNameLower}/query.do?" + getUrlParams("form1",true);;
            var para = "";
            var colM = [//colM：表头名称
                <#list fieldList as var>
            	{ title: "${var[3]}", width: 100, align: "center"},
				</#list>
            ];
            //fields：要显示字段
            var fields = [
                <#list fieldList as var>
				"${var[2]}",
				</#list>
            ];
            PQList("#gridList", url, colM, fields, 20, true,false,3,"0");
            $("#gridList").pqGrid({
            	freezeCols:3 
            });
        }
        function add(){
        	var url = "<%=root%>${classNameLower}/edit/0";
			top.openDlg(url, '信息 - 添加', 430, 320);
        }
 		function edit(){
 			var key = PQGetRowValue("#gridList", 0);
			if (isEditdata(key)) {
				var url = "<%=root%>${classNameLower}/edit/" + key;
				top.openDlg(url,'信息 - 编辑', 430, 320);
			}
        }
        //删除
		function del(){
 			var key = PQGetRowValue("#gridList", 0);
			if (isEditdata(key)) {
	 			//var param = {key:id};
	 			delConfirm("<%=root%>${classNameLower}/del.do?key="+key);
			}
 		}
    </script>
</head>
<body> 
    <form id="form1">
        <div class="tools_bar">
            <div style="float: left;">
            </div>
            <div style="text-align: right;">
				<%@ include file="/WEB-INF/views/layout/buttonBar.jsp"%> 
            </div>
        </div>
    </form>
    <div id="gridList" style="margin-top: 1px;"></div>
</body>
</html>